package com.project.jaijite.greendao.dao;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.project.jaijite.entity.DeviceInfo;
import com.project.jaijite.entity.LightInfo;
import com.project.jaijite.entity.MusicInfo;

import com.project.jaijite.greendao.dao.DeviceInfoDao;
import com.project.jaijite.greendao.dao.LightInfoDao;
import com.project.jaijite.greendao.dao.MusicInfoDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig deviceInfoDaoConfig;
    private final DaoConfig lightInfoDaoConfig;
    private final DaoConfig musicInfoDaoConfig;

    private final DeviceInfoDao deviceInfoDao;
    private final LightInfoDao lightInfoDao;
    private final MusicInfoDao musicInfoDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        deviceInfoDaoConfig = daoConfigMap.get(DeviceInfoDao.class).clone();
        deviceInfoDaoConfig.initIdentityScope(type);

        lightInfoDaoConfig = daoConfigMap.get(LightInfoDao.class).clone();
        lightInfoDaoConfig.initIdentityScope(type);

        musicInfoDaoConfig = daoConfigMap.get(MusicInfoDao.class).clone();
        musicInfoDaoConfig.initIdentityScope(type);

        deviceInfoDao = new DeviceInfoDao(deviceInfoDaoConfig, this);
        lightInfoDao = new LightInfoDao(lightInfoDaoConfig, this);
        musicInfoDao = new MusicInfoDao(musicInfoDaoConfig, this);

        registerDao(DeviceInfo.class, deviceInfoDao);
        registerDao(LightInfo.class, lightInfoDao);
        registerDao(MusicInfo.class, musicInfoDao);
    }
    
    public void clear() {
        deviceInfoDaoConfig.clearIdentityScope();
        lightInfoDaoConfig.clearIdentityScope();
        musicInfoDaoConfig.clearIdentityScope();
    }

    public DeviceInfoDao getDeviceInfoDao() {
        return deviceInfoDao;
    }

    public LightInfoDao getLightInfoDao() {
        return lightInfoDao;
    }

    public MusicInfoDao getMusicInfoDao() {
        return musicInfoDao;
    }

}
